package com.lcy.redistest.jedispool;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

/**
 * @author lichenyang
 * @create 2021-04-28 4:58 下午
 */
public class JedisPoolMainTest {
    public static void main(String[] args) {
        JedisPool jedisPool = JedisPoolUtil.getJedisPool("127.00.1", 6379);
        Jedis jedis = null;
        try {
            jedis = jedisPool.getResource();
            jedis.set("k1", "1");
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            JedisPoolUtil.release(jedisPool, jedis);
        }
        jedisPool.close();
    }
}
